﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="Agathas.Storefront.Model.Orders"
        assembly="Agathas.Storefront.Model">

  <class name="OrderItem" table="OrderItems" lazy="false" >

    <id  name="Id" column="OrderItemId" unsaved-value="0">
      <generator class="native" />
    </id>

    <property access="field.camelcase-underscore" name="Quantity">
      <column name="Qty" sql-type="int" not-null="true" />
    </property>

    <property access="field.camelcase-underscore" name="Price">
      <column name="Price" sql-type="decimal" not-null="true" />
    </property>

    <many-to-one access="field.camelcase-underscore" name="Product"
                     class="Agathas.Storefront.Model.Products.Product"
                     column="ProductId"
                     cascade="none"
					           not-null="true"/>


    <many-to-one access="field.camelcase-underscore" name="Order"
                     class="Order"
                     column="OrderId"
                     not-null="true"
					  />

  </class>

</hibernate-mapping>